home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
system
/
epuptm17.zip
/
UPTIME.DOC
< prev
next >
Wrap
Text File
|
1994-04-24
|
5KB
|
107 lines
Uptime is a program that I wrote to mimic the UNIX uptime command. I went
looking around for one, and I found a few. The difference between uptime and
all the others (that I found at any rate) is that uptime needs no data files.
The other programs that I found either needed data files or were a TSR. The
data files ended up being mostly slack space, and the TSR's ate up memory.
I also didn't want another file in my root directory (hidden or otherwise).
Uptime needs to be in the path somewhere (If dos can find it, uptime can find
its self). you call it from your autoexec.bat file and tell it to set
itself. Then, whenever you run uptime, it will tell you how long it has
been since you last booted. It will also (optionally) keep a log file of
every time you boot. If you have to reboot for any reason, and you don't
want uptime to set its self, you can hold down either shift key, and it will
skip the reset.
Use uptime with any parameter other than "set", "log" and/or "tail" and it
will display a help screen.
Dvuptime is a modified version of uptime that is useful under DESQview. It
gives up it's timeslice (by polling the keyboard. Any program that polls the
keyboard loses it's timeslice by default) and waits for key to be pressed.
This is something that I hacked out in a short amount of time. I tested it,
and have been using it for quite some time. I don't think there are any
errors in it, but I can't be sure. If you encounter one, let me know and
I'll see if I can fix it.
Uploaded by the author, can be redistributed in the original form so long as
there is no charge (your getting it for free, so should everyone else).
Hey, I think it would be really nifty if you find the program useful enough
to keep on your hard drive, if you could send me a postcard and let me know
where you got uptime, what you think of it, etc...
Thanks
Eric S Peters
3414 S Pitkin Way
Aurora CO 80013 USA
peters@cs.colostate.edu
--Revisions
version 1.0
This version didn't include the "log" feature.
version 1.1
This version had the log, but you could only view the entire log.
This version was released, but nobody paid any attention to it.
version 1.2
Same as version 1.1, except I rewrote some really slow code.
First release that people actually used.
version 1.3
Fixed a bug with the TZ environment variable. I didn't even know about
this variable.
Put "(T)ail" and "(Q)uit" in the log feature. When the log gets big, it
takes a long time to list it all. This allows you to break out.
version 1.4
Fixed a problem with the MKS korn shell for dos. The korn shell doesn't
append a newline to the output of the exiting program like command.com,
4dos.com, and ndos.com.
Fixed a problem with the "(T)ail" feature of the log list. It wasn't
displaying the last launch. Also extended the tail from 10 to 20.
version 1.5
"Ported" to Borland C 3.1 from Turbo C 1.01. Basically, I needed to add
some more #include directives. Funny thing, the "eof" parameter is in
io.h. If I include io.h, I get a linker error about how it can't cast
my file pointers. If I leave it undefined, it works the way it is
supposed to. Oh well. I've learned to expect the unexpected with
Borland compilers.
Made "tail" a command line option. I found that I wanted the list,
but usually only wanted to see the tail. This saves a little time and
keystrokes.
version 1.6
added support for country codes in the config.sys. uptime will now
format the time and date as it should be for your country (don't
see how those Europeans can tell time like that, but oh well <grin>)
Left dvuptime in the archive, but didn't change it to support country
codes. I rarely ever use it, and I doubt anyone else does (switched
to OS/2 ya know!).
BTW, anybody know how to write a program that will run from dos, and
native in an os2 window? I have one that does it, and would like to
make uptime do it. Also, does anybody know how to make os2 call a
program at bootup? The os2 manuals aren't exactly made for programmers.
version 1.7
found my own bug with the ampm declarations when country info is U.S.
Also fixed a bug that I created in the log file with version 1.6 (It
was leaving a blank line at the top if there was no log.) This change
might make your logfile have 2 entries on the same line the first time
you run it. Sorry, but I'm not going to put in code to check for
this, because it will only happen once (went from appending a newline
at the begining of the log entry to the end.)
EOF